Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'CamelCase' to doc_valid_idents #3533

Merged
merged 1 commit into from
Dec 12, 2018

Conversation

phansch
Copy link
Member

@phansch phansch commented Dec 11, 2018

Fixes #2395

@phansch
Copy link
Member Author

phansch commented Dec 11, 2018

huh, AppVeyor fails with:

   Compiling failure v0.1.3
error[E0034]: multiple applicable items in scope
   --> C:\Users\appveyor\.cargo\registry\src\github.com-1ecc6299db9ec823\failure-0.1.3\src\backtrace\mod.rs:132:20
    |
132 |                 bt.fmt(f)
    |                    ^^^ multiple `fmt` found
    |
    = note: candidate #1 is defined in an impl of the trait `std::fmt::Debug` for the type `backtrace::backtrace::Backtrace`
    = note: candidate #2 is defined in an impl of the trait `std::fmt::Display` for the type `backtrace::backtrace::Backtrace`

@phansch
Copy link
Member Author

phansch commented Dec 11, 2018

Seems like that will be fixed by rust-lang-deprecated/failure#279

@phansch phansch closed this Dec 11, 2018
@phansch phansch reopened this Dec 11, 2018
@phansch
Copy link
Member Author

phansch commented Dec 12, 2018

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 12, 2018

📌 Commit ee2abc3 has been approved by phansch

@bors
Copy link
Collaborator

bors commented Dec 12, 2018

⌛ Testing commit ee2abc3 with merge f26c39b...

bors added a commit that referenced this pull request Dec 12, 2018
Add 'CamelCase' to doc_valid_idents

Fixes #2395
@bors
Copy link
Collaborator

bors commented Dec 12, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: phansch
Pushing f26c39b to master...

@bors bors merged commit ee2abc3 into rust-lang:master Dec 12, 2018
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 24, 2024
…eferences, r=RalfJung

Make file descriptors into refcount references

fixes rust-lang#3525

Remove `fn dup` in `trait FileDescription`, define `struct FileDescriptor(Rc<RefCell<dyn FileDescription>>)`, and use `BTreeMap<i32, FileDescriptor>` in `FdTable`.

---

There are some refactors similar to the following form:
```rust
{  // origin:
    if let Some(file_descriptor) = this.machine.fds.get_mut(fd) {
        // write file_descriptor
        this.try_unwrap_io_result(result)
    } else {
        this.fd_not_found()
    }
}
{  // now:
    let Some(mut file_descriptor) = this.machine.fds.get_mut(fd) else {
        return this.fd_not_found();
    };
    // write file_descriptor
    drop(file_descriptor);
    this.try_unwrap_io_result(result)
}
```
The origin form can't compile because as using `RefCell` to get interior mutability, `fn get_mut` return `Option<std::cell::RefMut<'_, dyn FileDescription>>` instead of `Option<&mut dyn FileDescription>` now, and the `deref_mut` on `file_descriptor: RefMut` will cause borrow `this` as mutable more than once at a time.
So this form of refactors and manual drops are are implemented to avoid borrowing `this` at the same time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants